package cn.ckx.coding.common.utils.hash;

import java.io.InputStream;

/**
 * md5工具
 * 
 * @author kunxin.cai
 */
public class MD5Utils {
    
    private static final String ALGORITHM = "MD5"; 

    private static Checksum checkSum = new Checksum(ALGORITHM);

    public static String hash(String s) {
        return checkSum.hash(s);
    }

    public static String hash(byte[] source) {
        return checkSum.sum(source);
    }

    public static String hash(InputStream in) {
        return checkSum.sum(in);
    }

  
}
